<%@page import="AO.Course" contentType="text/html" pageEncoding="UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>new courses to be started:</title>
<link rel="stylesheet" href="styles/style.css" type="text/css" media="screen" />
   <style type="text/css">
.art-post .layout-item-0 { padding-right: 10px;padding-left: 10px; }
   .ie7 .art-post .art-layout-cell {border:none !important; padding:0 !important; }
   .ie6 .art-post .art-layout-cell {border:none !important; padding:0 !important; }
   </style>

</head>
<body>
    
        <%if(request.getParameter("status").equals("1")) 
          out.println("<script>alert('course not started')</script>"); 
         %>
<div id="art-page-background-glare-wrapper">
    <div id="art-page-background-glare"></div>
</div>
<div id="art-main">
    <div class="cleared reset-box"></div>
    <div class="art-box art-sheet">
        <div class="art-box-body art-sheet-body">
            <div class="art-layout-wrapper">
                <div class="art-content-layout">
                    <div class="art-content-layout-row">
                        <div class="art-layout-cell art-content">
<div class="art-box art-post">
    <div class="art-box-body art-post-body">
<div class="art-post-inner art-article">
                                <h2 class="art-postheader">courses:
                                </h2>
                                                <div class="art-postcontent">
<div class="art-content-layout">
    <div class="art-content-layout-row">
    <div class="art-layout-cell layout-item-0" style="width: 100%;">
        <br />
        
        <table class="art-article" border="0" cellspacing="0" cellpadding="0" style="width: 100%;background-color: #FFFFFF">
            <tbody>
                <%
                 String userid=((AO.Login)session.getAttribute("logindata")).getUserid();
         String[] ids=helper.course.getUserCourseIds(userid,true);
         int i=0;
         if(ids!=null)
         for(i=0;i<ids.length;i++)
            {//"validate?courseid=<%=ids[i]+"&action=takeclass"
            
         %>      
                <tr style="margin-top:2px">
                    <td><%=ids[i]%></td>
        
                    <td><a href="http://localhost:5080/vod/recv/sender.html" style="font-weight: bold; color: #FA5A0A;">attend class<%%></a></td>
        
                    <td><a href="validate?courseid=<%=ids[i]+"&action=showdownloads"%>" style="font-weight: bold; color: #1111FF;">download content<%%></a></td>
        
                    <td><a href="validate?courseid=<%=ids[i]+"&action=viewtests"%>" style="font-weight: bold; color: #234543;"> tests </a></td>
                    <%
                    String nstatus;
                    int sdays=helper.course.startedDays(ids[i]);
                    if(sdays!=0)nstatus=(sdays>0)?"started "+sdays+" days ago":"will start in "+Math.abs(sdays)+" days";
                    else nstatus="started today";
                    %>
                    <td border="0"><%=nstatus%></td>
                    <%
                      int rdays=helper.course.remainingDays(ids[i]);
                      String status;
                        if(rdays!=0)
                        {
                         status=rdays>0?"will complete in "+rdays+" days":"completed "+Math.abs(rdays)+" days ago"; 
                        }
                        else status="will complete today";
                    %>
                    <td border="0"><%=status%></td>
                </tr><%}%>
            </tbody>
        </table>
    </div>
    </div>
</div>

                </div>
                <div class="cleared"></div>
                </div>

		<div class="cleared"></div>
    </div>
</div>

                          <div class="cleared"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="cleared"></div>
           
    		
        </div>
    </div>

</div>

</body>
</html>
